<%- @page_title = _('Viewing File "%s" by Group %s', h(@upload.title), h(@group.name)) -%>
<h2><%= _("%s for %s", link_to(h(@upload.title), @upload.url), h(@group.name)) %>
  <%- if(@logged_user.is_teacher? || @group.is_member?(@logged_user)) -%>
    <span class="quick-tip"><%= link_to((@logged_user.is_teacher? ? _("Add notes") : _('Edit')), edit_upload_path(@project, @teaching, @group, @upload)) %></span>
  <%- end -%>
</h2>

<div class="formatted-text"><!--O .formatted-text-->
  <p>
    <%- unless @upload.deadline.nil? -%>
      <%= @upload.final? ? _("It's the final version for deadline <strong>%s</strong>", link_to(h(@upload.deadline.title), deadline_path(@project, @teaching, @upload.deadline.id))) : _("Uploaded for deadline <strong>%s</strong> (not final)", link_to(h(@upload.deadline.title), deadline_path(@project, @teaching, @upload.deadline.id)))%><br />
    <%- end -%>
    <%= _("Uploaded by %s", h(@upload.user.name)) %>
  </p>
  <%- unless @upload.description.blank? -%>
    <hr />
    <%= simple_format(h(@upload.description)) %>
  <%- end -%>
  <%- unless @upload.notes.blank? -%>
    <hr />
    <p><strong>Notes from the teacher:</strong></p>
    <%= simple_format(h(@upload.notes)) %>
  <%- end -%>
</div><!--C .formatted-text-->

<%- if(@group.is_member?(@logged_user)) -%>
  <hr />
  <%- form_tag(upload_path(@project, @teaching, @group, @upload),
                :method => :delete,
                :onsubmit => "if(confirm('#{_('Are you sure you want to delete this file?')}')){Field.disable('submit-form'); return true;}else{return false;}") do -%>
    <%= submit_tag(_('Delete this file'),
                    :class => 'button',
                    :id => 'submit-form') %>
  <%- end -%>
<%- end -%>
<hr />
<%= link_to(_("&laquo; Back to files"), uploads_path(@project, @teaching, @group)) %>
